package userTests;

import org.testng.annotations.Test;
import org.openqa.selenium.*;

public class AddAccountTests extends TestBaseUser {
       
    @Test
    public void testAddAccount() {
    	openMainPageUser();
		gotoSignInUser();
		LoginLogoutDataUser login = new LoginLogoutDataUser();
		login.phoneNumber = "959999999";
		login.password = "!23Qwe";
		fillSignInUser(login);
		submitSignInUser();
		
        gotoAddNewCurrency();
        
//      if (!wd.findElement(By.xpath("//form[@class='form-inline']/fieldset/select//option[2]")).isSelected()) {
//           wd.findElement(By.xpath("//form[@class='form-inline']/fieldset/select//option[2]")).click();
//        }
//        wd.findElement(By.cssSelector("a.btn.btn-success")).click();
        
        submitAddCurrency();
        
//        if (!wd.findElement(By.xpath("//form[@class='form-inline']/fieldset/select//option[3]")).isSelected()) {
//            wd.findElement(By.xpath("//form[@class='form-inline']/fieldset/select//option[3]")).click();
//        }
//        wd.findElement(By.cssSelector("button.btn.btn-primary ")).click();
//        wd.findElement(By.id("btnRefreshAccountsList")).click();
//        wd.findElement(By.xpath("//table[@class='table-balances-current']/tbody/tr[2]/td[1]/div")).click();
//        wd.findElement(By.cssSelector("#59 > td.pointer")).click();
//        alert alert-block alert-success        
    }

	private void submitAddCurrency() {
		wd.findElement(By.id("currency")).click();
	}

	private void gotoAddNewCurrency() {
		wd.findElement(By.cssSelector("a.btn.btn-success")).click();
	}
    
}
